package top.buluoluo.ordersservice.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import top.buluoluo.commoncore.domain.response.Result;
import top.buluoluo.ordersservice.dto.respone.SkuDTO;
import top.buluoluo.ordersservice.dto.respone.SpuDTO;

/**
 * Product Service Feign 客户端
 */
@FeignClient(name = "product-service", url = "${feign.client.product-service.url:}")
public interface ProductServiceClient {

    /**
     * 检查折扣有效性
     */
    @GetMapping("/discount/checkDiscountValid/{discountId}")
    Result<Boolean> checkDiscountValid(@PathVariable("discountId") Long discountId);
    /**
     * 获取商品信息(sku)表
     */
    @GetMapping("/product/getSkuBySpuId/{skuId}")
    Result<SkuDTO> getSkuBySpuId(@PathVariable("skuId") Long skuId);
    /**
     * 获取商品信息(spu)表
     */
    @GetMapping("/product/getDetailProduct/{spuId}")
    Result<SpuDTO> getSpuBySpuId(@PathVariable("spuId") Long spuId);

}